/**
 * AbstractCategoriesListPane.java
 * @author: liuex
 * 2008-1-9 ����08:00:19
 *
 * note: 
 */
package org.lex.swing.prefs;

import java.beans.PropertyChangeListener;

import javax.swing.JComponent;

public abstract class CategoriesModel extends JComponent {
	public static final String SELECTED_CATEGORY_CHANGED_PROPERTY = "selectedCategoryChangedProperty";

	public abstract void addCategories(Category... categories);

	public void addCategoryChangedListener(PropertyChangeListener l) {
		this.addPropertyChangeListener(SELECTED_CATEGORY_CHANGED_PROPERTY, l);
	}

	public void removeCategoryChangedListener(PropertyChangeListener l) {
		this.removePropertyChangeListener(SELECTED_CATEGORY_CHANGED_PROPERTY, l);
	}

	public void fireSelectedCategoryChanged(String title) {
		this.firePropertyChange(SELECTED_CATEGORY_CHANGED_PROPERTY, null, title);
	}
}
